/**
 * @file models/overview.js
 * @author
 */
import {routerRedux} from 'dva/router';
import api from '../api';

export default {
  namespace : 'role',
  state : {
    roles:[],
  },

  effects : {

    * getRoles({
      payload
    }, {call, put, select}) {
      const roles=(yield call(api.role.getRoles)).data
      yield put({
        type:'setState',
        payload:{
          roles,
        }
      })
    },
  },
  reducers : {
    setState(state, {payload}) {
      return {
        ...state,
        ...payload
      }
    },
  }
}
